import 'package:flutter/material.dart';

import 'hotMovieData.dart';

class HotMovieItem extends StatefulWidget {
  HotMovieData hotMovieData;

  HotMovieItem(this.hotMovieData);
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return HotMovieItemState();
  }
}

class HotMovieItemState extends State<HotMovieItem> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      height: 160,
      padding: EdgeInsets.all(20),
      child: Row(
        children: [
          Image.network(
            widget.hotMovieData.images,
            width: 80,
            height: 120,
            fit: BoxFit.cover,
          ),
          Expanded(
            flex: 1,
            child: Padding(
              padding: EdgeInsets.only(left: 20),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    widget.hotMovieData.title,
                    style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
                  ),
                  Text(
                    widget.hotMovieData.rating.toString(),
                    style: TextStyle(fontSize: 14, color: Colors.black54),
                  ),
                  Text(
                    '导演：' + widget.hotMovieData.directors,
                    style: TextStyle(fontSize: 14, color: Colors.black54),
                  ),
                  Text(
                    '主演：' + widget.hotMovieData.casts,
                    style: TextStyle(fontSize: 14, color: Colors.black54),
                  ),
                ],
              ),
            ),
          ),
          Container(
            width: 100,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  widget.hotMovieData.watchedPeople.toString(),
                  style: TextStyle(fontSize: 14, color: Colors.red),
                ),
                OutlineButton(
                  child: Text('购票'),
                  color: Colors.red,
                  textColor: Colors.red,
                  highlightedBorderColor: Colors.red,
                  borderSide: BorderSide(color: Colors.red),
                  onPressed: () {},
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}
